package com.tanhua.app.service;

import com.tanhua.api.mongo.UserLocationApi;
import com.tanhua.app.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service
public class BaiduService {

    @Reference
    private UserLocationApi userLocationApi;

    public ResponseEntity uploadLocation(Double latitude, Double longitude, String address) {
        userLocationApi.save(latitude, longitude, address, UserHolder.getUserId());
        return ResponseEntity.ok(null);
    }
}
